<script setup lang="ts">
import { ref } from 'vue';
import routes from '@/router';
import {useRouter,RouteRecordRaw} from 'vue-router'

const routerList = useRouter().getRoutes().filter(item=>{
  return item?.children?.length>0
})[0].children
const menuList = ref<RouteRecordRaw[]|any>(routerList);

</script>

<template>
  <a-menu
      :defaultSelectedKeys="[$route.path]"
      :selectedKeys="[$route.path]"
      mode="inline"
  >
    <div v-for="menu in menuList" :key="menu.meta.index">
        <a-menu-item :key="menu.path">
          <template #icon>
            <component :is="menu.meta.icon" />
          </template>
          <router-link :to="menu.path">
            <span class="nav-text">{{ $t("nav."+menu.meta.title) }}</span>
          </router-link>
        </a-menu-item>
      </div>
  </a-menu>
</template>

<style scoped>
</style>